package com.wzh.demo;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.map.MapUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

/**
 * @description:
 * @author: WZH
 * @time: 2021/7/10 10:04
 */
public class Demo2 {

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    static class User{
        private String name;
        private String sex;
        private Integer age;
    }


    public static void main(String[] args) {
//        ArrayList<User> list = new ArrayList<>();
//        list.add(new User("李光头","男",18));
//        list.add(new User("宋钢","男",19));
//        list.add(new User("宋凡平","男",46));
//        list.add(new User("李兰","女",43));
//        list.add(new User("林红","女",18));
//        list.add(new User("路人甲","男",23));
//        list.add(new User("路人乙","女",22));
//
//
//         list.stream().filter(user -> user.getSex().equals("男")).


        HashMap<String, BigDecimal> map = new HashMap<>();
        map.put("张", Convert.toBigDecimal(15));
        map.put("李", Convert.toBigDecimal(12));
        map.put("赵", Convert.toBigDecimal(10));
        map.put("王", Convert.toBigDecimal(1));


        Set<Map.Entry<String, BigDecimal>> entries = map.entrySet();

        ArrayList<Map> list = new ArrayList<>();

        HashMap<Object, Object> map1 = new HashMap<>();
        HashMap<Object, Object> map2 = new HashMap<>();
        HashMap<Object, Object> map3 = new HashMap<>();
        for (Map.Entry<String, BigDecimal> entry : entries) {
            String key = entry.getKey();
            BigDecimal value = entry.getValue();
            map1.put(key,value.multiply(Convert.toBigDecimal(0.5)));
            map2.put(key,value.multiply(Convert.toBigDecimal(0.1)));
            map3.put(key,value.multiply(Convert.toBigDecimal(2)));
        }

        list.add(map);
        list.add(map1);
        list.add(map2);
        list.add(map3);
        Map map4 = list.get(0);









    }



}
